package cn.edu.hqu.tkserver.modules.tk.api;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import cn.edu.hqu.tkserver.common.utils.R;
import cn.edu.hqu.tkserver.modules.tk.entity.TicketEntity;
import cn.edu.hqu.tkserver.modules.tk.service.TicketService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("/api/ticket/")
public class ApiTicketController {
	
	@Autowired
	private TicketService tikectService;
	
	@AuthIgnore
	@GetMapping("list")
    public R list(@RequestParam Map<String, Object> params) {
		List<TicketEntity> ticketList = tikectService.queryList(params);
    	return R.ok().put("ticketList", ticketList);
    }
	
	@AuthIgnore
    @GetMapping("detail")
    public R detail(Integer id) {
    	TicketEntity ticket = tikectService.queryObject(id);
    	return R.ok().put("ticket", ticket);
    }
}
